package com.etonedu.meals.bean;

import android.os.Parcel;
import android.os.Parcelable;

import io.objectbox.annotation.Entity;
import io.objectbox.annotation.Id;

@Entity
public class MachineTimeBean implements Parcelable {
    /**
     * offDate : 2019-01-14-18-30
     * offTime : 1547461800000
     * onDate : 2019-01-15-07-00
     * onTime : 1547506800000
     */
    @Id
    private Long id;
    private String offDate;
    private long offTime;
    private String onDate;
    private long onTime;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getOffDate() {
        return offDate;
    }

    public void setOffDate(String offDate) {
        this.offDate = offDate;
    }

    public long getOffTime() {
        return offTime;
    }

    public void setOffTime(long offTime) {
        this.offTime = offTime;
    }

    public String getOnDate() {
        return onDate;
    }

    public void setOnDate(String onDate) {
        this.onDate = onDate;
    }

    public long getOnTime() {
        return onTime;
    }

    public void setOnTime(long onTime) {
        this.onTime = onTime;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(this.id);
        dest.writeString(this.offDate);
        dest.writeLong(this.offTime);
        dest.writeString(this.onDate);
        dest.writeLong(this.onTime);
    }

    public MachineTimeBean() {
    }

    protected MachineTimeBean(Parcel in) {
        this.id = (Long) in.readValue(Long.class.getClassLoader());
        this.offDate = in.readString();
        this.offTime = in.readLong();
        this.onDate = in.readString();
        this.onTime = in.readLong();
    }

    public static final Creator<MachineTimeBean> CREATOR = new Creator<MachineTimeBean>() {
        @Override
        public MachineTimeBean createFromParcel(Parcel source) {
            return new MachineTimeBean(source);
        }

        @Override
        public MachineTimeBean[] newArray(int size) {
            return new MachineTimeBean[size];
        }
    };
}
